package string;

public class Split {
    private static final String DOMAIN_USER_SEPARATOR = "\\";
    public static void main(String[] args) {
        System.out.println("-------------------");
        String[] splitMyDomainName = "RSSM\\Roy.Yang".split("\\\\", 2);
        for (String s : splitMyDomainName)
        {
            System.out.println(s);            
        }

        System.out.println("-------------------");
        splitMyDomainName = "RSSM\\DEV\\Roy.Yang".split(DOMAIN_USER_SEPARATOR + DOMAIN_USER_SEPARATOR, 2);
        for (String s : splitMyDomainName)
        {
            System.out.println(s);            
        }
        
        System.out.println("-------------------");
        splitMyDomainName = "Roy.Yang".split("\\\\", 2);
        for (String s : splitMyDomainName)
        {
            System.out.println(s);            
        }
        
        System.out.println("RSSM01".matches("(?i).*" + "m01" + "$"));
    }
}
